#!/usr/bin/python
import os,sys
def splitGraph(n):
	indep = range(0,n)
	domin = range(n,2*n)
	
	print "%d %d" % (2*n,n+(n*(n-1))/2)
	for i in indep:
		print "%d %d" % (i,i+n)
	for i in domin:
		for j in domin:
			if i < j:
				print "%d %d" % (i,j)
		
def main():
	st = int(sys.argv[1])
	end = int(sys.argv[2])
	gap = int(sys.argv[3])
	for i in range(st,end,gap):
		splitGraph(i)

if __name__ == "__main__":
	main()
